﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.ComponentModel;
using System.Workflow.Activities;
using System.Workflow.ComponentModel.Serialization;
using YakShaver.Contract;
namespace YakShaver.Contract
{
    [ExternalDataExchange]
    public interface INotificationService
    {

        event EventHandler<WorkItemModifiedEventArgs> HandleWorkItemModifiedEvent;

        /// <summary>
        /// Provider notifies users (or whatever) that some sort of action needs to be taken.  No return type as it waits
        /// for a response on an event.
        /// </summary>
        /// <param name="nofityCount">Number of times this event has occured for this workflow instance</param>
        /// <param name="workItem">The YakShaverWorkItem for this workflow instance</param>
        /// <returns>bool of whether or not it was successful</returns>
        bool NotifyForIntervention(int nofityCount, IWorkItemDataContract workItemDataContract);
    }

    [Serializable()]
    public class WorkItemModifiedEventArgs : ExternalDataEventArgs
    {
        private IWorkItemDataContract _modifiedWorkItem;
        public IWorkItemDataContract ModifiedWorkItem
        {
            get { return _modifiedWorkItem; }
        }


        public WorkItemModifiedEventArgs(Guid instanceId, IWorkItemDataContract modifiedWorkItemDataContract)
            : base(instanceId)
        {
            _modifiedWorkItem = modifiedWorkItemDataContract;
        }
    }
}
